package com.gcj.study07jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URL;

public class day7Util {
    public static void main(String[] args) throws Exception {
        day7Util.day7();
    }
    public static void day7() throws Exception {
        String url = "http://www.nmc.cn/publish/forecast/ASD/zichuan.html";
        Document document = Jsoup.parse(new URL(url), 30000);
        Elements elements = document.getElementById("day7").select(".weatherWrap");
        for (Element e : elements) {
            // System.out.println(e);
            System.out.println(e.select(".desc").get(0).html());
            System.out.println(e.select(".windd").get(0).html());
            System.out.println(e.select(".winds").get(0).html());
            System.out.println(e.select(".tmp").get(0).html());
            System.out.println(e.select(".tmp").get(1).html());
            System.out.println(e.select(".desc").get(1).html());
            System.out.println(e.select(".windd").get(1).html());
            System.out.println(e.select(".winds").get(1).html());

        }
    }

}
